/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.letmeshare.pedagogue.core.entities;

import java.io.Serializable;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import org.letmeshare.pedagogue.core.validation.ValidationException;
import org.letmeshare.pedagogue.core.validation.Validator;

/**
 *
 * @author ibisuser1
 */
@Entity
@Table(name="USER_ROLE")
public class Role implements Serializable, Validator {
    @Id
    private String id;
    
    @Column(unique=true)
    private String name;//name = ownerOrgPartyId + roleName
    @Column(name="ROLE_PRVLGS")
    @Enumerated(value= EnumType.STRING)
    private Set<Privilege> privileges;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    
    @Override
    public void validate() throws ValidationException {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
